package pta;/**
 * @author： li
 * @date： 2022-03-30 12:28
 * @version 1.0
 */
import java.io.*;

public class 字符串减法哈希表 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        char[] a = br.readLine().toCharArray();
        char[] b = br.readLine().toCharArray();
        boolean[] bool = new boolean[128];
        for(char i : b) {
            bool[i] = true;
        }
        for(char c : a) {
            if(!bool[c]) {
                out.write(a[c]);
            }
        }
        out.write("\n");
        br.close();
        out.flush();
    }
}
